<script type="text/javascript">
$(document).ready(function(){
$('#tabs div').hide();
$('#tabs div:first').show();
$('#tabs ul li:first').addClass('active');
$('#tabs ul li a').click(function(){
$('#tabs ul li').removeClass('active');
$(this).parent().addClass('active');
var currentTab = $(this).attr('href');
$('#tabs div').hide();
$(currentTab).show();
return false;
});
});
</script>
<style type="text/css">
* {
	margin: 0;
	padding: 0;
}
#tabs {
	font-size: 90%;
	margin: 20px 0;
}
#tabs ul {
	float: left;
	background: #fff;
	width: 500px;
	padding-top: 4px;
}
#tabs li {
	margin-left: 8px;
	list-style: none;
}
* html #tabs li {
	display: inline;
}
#tabs li, #tabs li a {
	float: left;
}
#tabs ul li.active {
	border-top:2px #FFFF66 solid;
	background: #FFFFCC;
}
#tabs ul li.active a {
	color: #333333;
}
#tabs div {
	background: #FFFFCC;
	clear: both;
	padding: 15px;
	min-height: 200px;
}
#tabs div h3 {
	margin-bottom: 12px;
}
#tabs div p {
	line-height: 150%;
}
#tabs ul li a {
	text-decoration: none;
	padding: 8px;
	color: #000;
	font-weight: bold;
}
.thumbs {
	float:left;
	border:#000 solid 1px;
	margin-bottom:20px;
	margin-right:20px;
}

</style>
<div id="tabs">
    
   <ul>
     <li><a href="#tab-1">Orders - Pending Delivery </a></li>
     <li><a href="#tab-2">Orders- On Delivery </a></li>
     <li><a href="#tab-3">Paid Orders - Pending Delivery </a></li>
     <li><a href="#tab-4">Orders-Delivery Confirmed</a></li>
   </ul>
   <div id="tab-1">
     <?php if($orderlist1):?>
<table width="98%" cellspacing="1" cellpadding="2" style="line-height: 32px;" class="cart_tbl">
    <tr><td>Order Date</td><td>orderid</td><td>Paid</td><td>Delivered</td><td>&nbsp;</td><td>&nbsp;</td></tr>
    <?php foreach($orderlist1 as $list):?>
    <tr>
        <td><?php echo $list["order_date"];?></td>
        <td><?php echo $list["order_id"];?></td>
        <td><?php echo ($list["ispaid"])==1?"YES":"NO";?></td>
        <td><?php echo ($list["isdelivered"])==1?"YES":"NO";?></td>
        <td><a href="<?php echo  SITEURL;?>index.php?viewextranetorders/orderid/<?php echo $list["order_id"] ;?>">view</a></td>
         <td><a onclick="return confirm('Are you sure you want to cancel this order?') " href="<?php echo  SITEURL;?>index.php?cancelorder/orderid/<?php echo $list["order_id"] ;?>">Cancel Order</a></td>
    </tr>
    <?php endforeach;?>
</table>
<?php else: ?>
<p>Order list is empty</p>
<?php endif; ?>
 </div>
   <div id="tab-2">
     <?php if($orderlist2):?>
<table width="98%" cellspacing="1" cellpadding="2" style="line-height: 32px;" class="cart_tbl">
    <tr><td>Order Date</td><td>orderid</td><td>Paid</td><td>Delivered</td><td>&nbsp;</td></tr>
    <?php foreach($orderlist2 as $list):?>
    <tr>
        <td><?php echo $list["order_date"];?></td>
        <td><?php echo $list["order_id"];?></td>
        <td><?php echo ($list["ispaid"])==1?"YES":"NO";?></td>
        <td><?php echo ($list["isdelivered"])==1?"YES":"NO";?></td>
        <td><a href="<?php echo  SITEURL;?>index.php?viewextranetorders/orderid/<?php echo $list["order_id"] ;?>">view</a></td>
    </tr>
    <?php endforeach;?>
</table>
<?php else: ?>
<p>Order list is empty</p>
<?php endif; ?>
   </div>
   <div id="tab-3">
     <?php if($orderlist3):?>
<table width="98%" cellspacing="1" cellpadding="2" style="line-height: 32px;" class="cart_tbl">
    <tr><td>Order Date</td><td>orderid</td><td>Paid</td><td>Delivered</td><td>&nbsp;</td></tr>
    <?php foreach($orderlist3 as $list):?>
    <tr>
        <td><?php echo $list["order_date"];?></td>
        <td><?php echo $list["order_id"];?></td>
        <td><?php echo ($list["ispaid"])==1?"YES":"NO";?></td>
        <td><?php echo ($list["isdelivered"])==1?"YES":"NO";?></td>
        <td><a href="<?php echo  SITEURL;?>index.php?viewextranetorders/orderid/<?php echo $list["order_id"] ;?>">view</a></td>
    </tr>
    <?php endforeach;?>
</table>
<?php else: ?>
<p>Order list is empty</p>
<?php endif; ?>
   </div>
   <div id="tab-4">
     <?php if($orderlist4):?>
<table width="98%" cellspacing="1" cellpadding="2" style="line-height: 32px;" class="cart_tbl">
    <tr><td>Order Date</td><td>orderid</td><td>Paid</td><td>Delivered</td><td>&nbsp;</td></tr>
    <?php foreach($orderlist4 as $list):?>
    <tr>
        <td><?php echo $list["order_date"];?></td>
        <td><?php echo $list["order_id"];?></td>
        <td><?php echo ($list["ispaid"])==1?"YES":"NO";?></td>
        <td><?php echo ($list["isdelivered"])==1?"YES":"NO";?></td>
        <td><a href="<?php echo  SITEURL;?>index.php?viewextranetorders/orderid/<?php echo $list["order_id"] ;?>">view</a></td>
    </tr>
    <?php endforeach;?>
</table>
<?php else: ?>
<p>Order list is empty</p>
<?php endif; ?>
   </div>
 </div>
